package com.ytx.flutter_ytx_plugin.x5

import android.content.Context
import com.ytx.flutter_ytx_plugin.X5Response
import io.flutter.plugin.common.BinaryMessenger
import io.flutter.plugin.common.StandardMessageCodec
import io.flutter.plugin.platform.PlatformView
import io.flutter.plugin.platform.PlatformViewFactory

/**
 * @author :  huangzhen
 * date    :  2023/12/30
 * describe:  android
 */
class X5PlatformViewFactory(private val messenger: BinaryMessenger,private val x5Response: X5Response
) :
    PlatformViewFactory(StandardMessageCodec.INSTANCE) {
    private var webView: X5WebView? = null;
    override fun create(context: Context, viewId: Int, args: Any?): PlatformView {
        webView = X5WebView(context,x5Response, messenger,args as Map<String, Any>, viewId)
        return webView!! ;
    }
    fun  getView(): X5WebView? {
        return webView;
    }

}